<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function test(color, uname, cartype, carmode) {
        this.color = color;
        this.uname = uname;
        this.carmode = carmode;
        this.cartype = cartype;
        console.log("this", this);
      }

      test.prototype.say = function () {
        console.log("this", this);
        return this.uname + "爱" + this.cartype;
      };
      let car = new test("red", "小明", "benz", "auto");
      let car2 = new test("blue", "小红", "audi", "manual");
      let car3 = new test("yellow", "小刚", "bmw", "auto");

      console.log(car);
      console.log(car);
      console.log(car3);
    </script>
  </body>
</html>
